<template>
  <div class="userinfo">
    <nav-bar />
    <img src="~images/bannerTop_new.png" alt="" class="backImg" />
    <user-detail :userInfo="model" />
  </div>
</template>

<script>
  import NavBar from '@/components/common/Navbar'
  import UserDetail from '@/components/userComponent/userDetail.vue'
  export default {
    data() {
      return {
        model: {},
      }
    },
    components: {
      NavBar,
      UserDetail,
    },
    methods: {
      async userinfoData() {
        const res = await this.$http.get('/user/' + localStorage.getItem('id'))
        this.model = res.data[0]
        console.log(res.data)
      },
    },
    created() {
      this.userinfoData()
    },
  }
</script>

<style lang="stylus" scoped>
  .userinfo
    .backImg
      height: 91px
      width: 100%
</style>